import request from '@/utils/request'
import store from '@/store/index.js' // store
import auth from '@/plugins/auth.js'

// 查询改造审核信息列表
export function QueryGzAuditList(UrlParams, body) {
	if (!auth.hasRole("admin")) { //没有admin权限的情况下添加请求条件
		body.queryParam.permanentDistrict = store.state.user.user.remark
	}
	//console.log('this.$store.user：', store.state.user)
	console.log('QueryGzAuditList', {
		url: '/slhgz/slhgzpg/list',
		method: 'get',
		params: UrlParams,
		data: body
	});
	return request({
		url: '/slhgz/slhgzpg/list',
		method: 'get',
		params: UrlParams,
		data: body
	})
}

// 查询指定改造审核项详细信息
export function getGzAudit(Id) {
	return request({
		url: '/slhgz/slhgzpg/' + Id,
		method: 'get'
	})
}

// 新增改造审核信息
export function addGzAudit(data) {
	// console.log('addGzAudit',{
	//   url: '/elder/GzAudit/save',
	//   method: 'post',
	//   data: data
	// });
	return request({
		url: '/slhgz/slhgzpg/',
		method: 'post',
		data: data
	})
}

// 修改改造审核信息
export function updateGzAudit(data) {
	console.log('updateGzAudit',{
	  url:'/slhgz/slhgzpg/',
	  method: 'put',
	  data: data
	});
	return request({
		url: '/slhgz/slhgzpg/',
		method: 'put',
		data: data
	})
}

// 删除改造审核信息
export function delGzAudit(Ids) {
	return request({
		url: '/slhgz/slhgzpg/delete',
		method: 'delete',
		data: Ids
	})
}

//dev-api/system/administrativeDivisions/getAdministrativeDivisions
// 查询分级行政区域
export function getAdministrativeDivisions(UrlParams) {
	return request({
		url: '/system/administrativeDivisions/getAdministrativeDivisions',
		method: 'get',
		params: UrlParams,
		data: null
	})
}
